VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Regens"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

'Number of tools in this server
Const NUM_TOOLS = 1
Const gkGraphic = 11
Const gkGroup = 7
'Toggle this to test loading buttons from .Bmp/.Res
'Const boolLoadFromBmp As Boolean = False
Const boolDebug As Boolean = False

'Return a description string for this package of tools
Public Property Get Description() As String
    Description = "Insert External Object tool"
End Property

'Called to perform tool function
Public Function Run(ByVal Tool As Object) As Boolean
    Dim objApp As Object
    Dim Drs As Object
    Dim ActDr As Object
    Dim RegMets As Object

    'Look for first URL property in the selection
    Set objApp = Tool.Application
    Set ActDr = objApp.ActiveDrawing
    Set Grs = ActDr.Graphics
    Dim Count As Long
    ' get count of Custom Objects (Regen methods)
    Count = Tool.Application.RegenMethods.Count
    Dim i As Integer, k%
    k = 0
    Dim Str1$, Str2$, Str3
    For i = 0 To Count - 1
    Str2 = ""
On Error Resume Next

       Str3 = Tool.Application.RegenMethods.Item(i).Type
       If Str3 = imsiAutomation Then
            Str2 = Tool.Application.RegenMethods.Item(i).Description
                    
                    Str1 = Tool.Application.RegenMethods.Item(i).Name
            ' cut some service custom objects from the list
            If Str1 = "HatchWizard.HatchWizard.1" Then
                GoTo RR
            ElseIf Str1 = "Smart.Connection.1" Then
                GoTo RR
            ElseIf Str1 = "Viewport.DimensionConnection.1" Then
                GoTo RR
            ElseIf Str1 = "Foundation.House" Then
                GoTo RR
            ElseIf Str1 = "AutoDim.House" Then
                GoTo RR
            ElseIf Str1 = "Schedule.Block" Then
                GoTo RR
            ElseIf Str1 = "TextAlong.Curve" Then
                GoTo RR
            ElseIf Str1 = "Fillet3D_Regen.Fillet3D" Then
                GoTo RR
            Else
                    
                    frmToolReg.List1.List(k) = Str1
                    frmToolReg.List1.ItemData(k) = i
                    k = k + 1
            End If
            

        End If
RR:
    Next i
    frmToolReg.List1.Selected(0) = True
    frmToolReg.Show 1
    
    
    Set Grs = Nothing
    Set ActDr = Nothing
    Set RegMets = Nothing
    Set Drs = Nothing
    Set objApp = Nothing

    Run = True
End Function

'Fill arrays with information about tools in the package
'Return the number of tools in the package
Public Function GetToolInfo(CommandNames As Variant, MenuCaptions As Variant, StatusPrompts As Variant, _
    ToolTips As Variant, Enabled As Variant, WantsUpdates As Variant) As Long
    ReDim CommandNames(NUM_TOOLS)
    ReDim MenuCaptions(NUM_TOOLS, 2)
    ReDim StatusPrompts(NUM_TOOLS)
    ReDim ToolTips(NUM_TOOLS)
    ReDim Enabled(NUM_TOOLS)
    ReDim WantsUpdates(NUM_TOOLS)
'    CommandNames(0) = "SDK|Regens"
'    MenuCaptions(0) = "&SDKRegens"
    CommandNames(0) = "&AddOns|S&DK Samples|&Insert|Custom Object2" + "#CMD_SDKCUSTMOBJECT2"
    MenuCaptions(0, 0) = "Custom Object2"
    MenuCaptions(0, 1) = "SDK Samples" ' toolbar name
    StatusPrompts(0) = ""
    ToolTips(0) = "SDK External objects (Regens)"
    Enabled(0) = True
    WantsUpdates(0) = False
    GetToolInfo = NUM_TOOLS
End Function



'Returns true if tool is correctly initialized
Public Function Initialize(ByVal Tool As Object) As Boolean
    Initialize = True
End Function

'Returns true if tool is correctly initialized
Public Function UpdateToolStatus(ByVal Tool As Object, Enabled As Boolean, Checked As Boolean) As Boolean
    Enabled = True 'Could do a test here to determine whether to disable the button/menu item
    Checked = False  'Could do a test here to determine whether to check the button/menu item
    UpdateToolStatus = True
End Function

